const Classify = () => import('__VIEWS__/classify/Classify.vue')
// import Classify from '__VIEWS__/classify/Classify.vue'
const FunctionalityDisplay = () => import('__VIEWS__/classify/FunctionalityDisplay.vue')
// import FunctionalityDisplay from '__VIEWS__/classify/FunctionalityDisplay.vue'
const TagDisplay = () => import('__VIEWS__/classify/TagDisplay.vue')
// import TagDisplay from '__VIEWS__/classify/TagDisplay.vue'
const BaseFrameSet = () => import('__LAYOUTS__/base_frame_set/BaseFrameSet.vue') 
// import BaseFrameSet from '__LAYOUTS__/base_frame_set/BaseFrameSet.vue'

// 有router-view 的组件都不能用 functional 函数式
const ClassifyFrameSetComponent = {
  name: 'ClassifyFrameSetComponent',
  render(createElement, context) {
    return  createElement(BaseFrameSet, {class: 'mine'})
  }
}

export default {
  path: '/classify',
  name: 'Classify',
  meta: { title: '分类' },
  component: ClassifyFrameSetComponent,
  redirect: {name: 'FunctionalityIndex'},
  children: [{
    path: 'functionality_index',
    name: 'FunctionalityIndex',
    meta: { title: '功能分类' },
    component: Classify,
  }, {
    path: 'functionality/:functionalityId',
    name: 'FunctionalityDisplay',
    meta: { title: '功能文章' },
    props: (route)=>{
      const { functionalityId } = route.params
      return {functionalityId, id: functionalityId}
    },
    component: FunctionalityDisplay,
  }, {
    path: 'tag/:tagId',
    name: 'TagDisplay',
    meta: { title: '标签文章' },
    props: (route)=>{
      const { tagId } = route.params
      return {tagId, id: tagId}
    },
    component: TagDisplay,
  }]
}